package com.imddysc.codemirror.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/codemirror")
public class CodeMirrorController {

	private static final Logger logger = LoggerFactory.getLogger(CodeMirrorController.class);
	
	@RequestMapping("/code.html")
	public String code() {
		return "codemirror/code";
	}
	
	@RequestMapping("/code1.html")
	public String code1() {
		return "codemirror/code1";
	}
	
	@ResponseBody
	@RequestMapping("/code1do.html")
	public String code1do(String code) {
		logger.info("请求进入code1do.html ... ");
		logger.info("CODE: " + code);
		
		return "codemirror/code1";
	}
	
	@RequestMapping("/code2.html")
	public String code2() {
		return "codemirror/code2";
	}
	
	@ResponseBody
	@RequestMapping("/code2do.html")
	public String code2do(String code) {
		logger.info("请求进入code2do.html ... ");
		logger.info("CODE: " + code);
		
		return "codemirror/code2";
	}
	
}
